package cn.itsource.exam.service.impl;

import cn.itsource.exam.domain.Exam;
import cn.itsource.exam.domain.Login;
import cn.itsource.exam.mapper.StudentMapper;
import cn.itsource.exam.query.ExamResultQuery;
import cn.itsource.exam.service.StudentService;
import cn.itsource.exam.util.PageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    StudentMapper studentMapper;
    @Override
    public PageList<Exam> selectExam(ExamResultQuery query) {
            int i = studentMapper.countExamList(query);
            if (i==0){
                return new PageList();
            }
            return new PageList(i,studentMapper.selectExam(query));
    }

    @Override
    public void updatePwdById(Login userInfo) {
        studentMapper.updatePwdById(userInfo);
    }

    @Override
    public Login selectById(Long id) {
        return studentMapper.selectById(id);
    }


}
